﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Pixysoft.Framework.Configurations
{
    public interface IXmlPropertyCollection :
        IEnumerable<IXmlProperty>, IEnumerator<IXmlProperty>
    {
        /// <summary>
        /// 是否包含属性
        /// </summary>
        /// <returns></returns>
        bool Contains(string key);

        /// <summary>
        /// 添加属性
        /// </summary>
        /// <param name="key"></param>
        /// <param name="value"></param>
        IXmlProperty Add(string key, string value);

        /// <summary>
        /// 移除
        /// </summary>
        /// <param name="key"></param>
        IXmlProperty Remove(string key);

        /// <summary>
        /// 根据index属性的获取
        /// </summary>
        /// <param name="index"></param>
        /// <returns></returns>
        IXmlProperty this[int index] { get;}

        /// <summary>
        /// 根据属性id获取属性
        /// </summary>
        /// <param name="propertyName"></param>
        /// <returns></returns>
        string this[string propertyName] { get;set;}

        /// <summary>
        /// 根据范型获取对象
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="propertyName"></param>
        /// <returns></returns>
        T Get<T>(string propertyName);

        /// <summary>
        /// 根据范型获取对象
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="propertyName"></param>
        /// <param name="format"></param>
        /// <returns></returns>
        T Get<T>(string propertyName, string format);

        /// <summary>
        /// 获取属性
        /// </summary>
        /// <param name="propertyName"></param>
        /// <returns></returns>
        IXmlProperty Get(string propertyName);

        /// <summary>
        /// 清空
        /// </summary>
        void Clear();

        /// <summary>
        /// 获取数据
        /// </summary>
        int Count { get;}
    }
}
